﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Pages/Admin/AdminMasterPage.master"
    AutoEventWireup="true" CodeFile="AfiseazaProduse.aspx.cs" Inherits="Pages_Admin_AfiseazaProduse" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
    <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" DataSourceID="AfiseazaProduseDataSource"
        AllowPaging="True" AllowSorting="True" DataKeyNames="ID" 
    onrowcommand="GridView1_RowCommand">
        <Columns>
            <asp:BoundField DataField="ID" HeaderText="ID" InsertVisible="False" ReadOnly="True"
                SortExpression="ID" />
            <asp:BoundField DataField="Nume" HeaderText="Nume" SortExpression="Nume" />
            <asp:BoundField DataField="Brand" HeaderText="Brand" SortExpression="Brand" />
            <asp:BoundField DataField="'Categorie'" HeaderText="Categorie" SortExpression="'Categorie'" />
            <asp:BoundField DataField="Price" HeaderText="Price" SortExpression="Price" />
            <asp:BoundField DataField="Views" HeaderText="Views" SortExpression="Views" />
            <asp:BoundField DataField="Rating" HeaderText="Rating" SortExpression="Rating" />
            <asp:BoundField DataField="code" HeaderText="Cod produs" SortExpression="code" />
            <asp:BoundField DataField="supplier_stock" HeaderText="Stoc furnizor" SortExpression="supplier_stock" />
            <asp:BoundField DataField="shop_stock" HeaderText="Stoc magazin" SortExpression="shop_stock" />
            <asp:BoundField DataField="created_at" HeaderText="Creat la" SortExpression="created_at" />
            <asp:BoundField DataField="updated_at" HeaderText="Modificat la" SortExpression="updated_at" />
            <asp:CheckBoxField DataField="is_active" HeaderText="E disponibil?" SortExpression="is_active"  />
            <asp:CheckBoxField DataField="deleted" HeaderText="E sters?" SortExpression="deleted" />
            <asp:TemplateField>
                <ItemTemplate>
                    <asp:Button ID="Modifica" runat="server" CommandName="Modifica" CommandArgument='<%# Eval("ID") %>'
                        Text="Modifica" />
                   
                    
                </ItemTemplate>
            </asp:TemplateField> 
            <asp:TemplateField>
                <ItemTemplate>
                     <asp:Button ID="Sterge" runat="server" CommandName="Sterge" CommandArgument='<%# Eval("ID") %>'
                        Text="Sterge"  />
                </ItemTemplate>
            </asp:TemplateField>

        </Columns>
    </asp:GridView>
    <asp:SqlDataSource ID="AfiseazaProduseDataSource" runat="server" ConnectionString="<%$ ConnectionStrings:StoreDBConnectionString %>"
        SelectCommand="SELECT Products.name AS 'Nume', Brands.brand_name AS 'Brand', Products.price AS 'Price', Products.views AS 'Views', Products.rating AS 'Rating', Product_Categories.category_name AS ['Categorie'], Products.deleted, Products.is_active, Products.created_at, Products.updated_at, Products.supplier_stock, Products.shop_stock, Products.code, Products.ID FROM Products INNER JOIN Brands ON Products.BrandID = Brands.ID INNER JOIN Product_Categories ON Products.CategoryID = Product_Categories.CategoryID">
    </asp:SqlDataSource>
</asp:Content>
